Skip to main content

All Questions

7votes
2answers
1kviews

Letter Combinations of a phone number using a Dictionary

Problem statement (online source) Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone ...
Shahin's user avatar
5votes
2answers
1kviews

Finding all possible letter combinations from an inputted phone number

Prompt: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone ...
springathing's user avatar
1vote
1answer
126views

Count all possible attendance records with length n, which will be regarded as rewardable

Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer may be very large, return it after \$\mod 10^9 + 7\$. ...
kumarmo2's user avatar
4votes
1answer
408views

Counting ways to fit bottles in crates

I'm calculating how many possibilities there are to fit \$n\$ identical bottles inside \$k\$ crates of various capacities. n = Number of bottles k = Number of crates K = List of the number of bottles ...
Deniz Alz's user avatar
10votes
2answers
449views

You need to diversify your strings

Challenge: Write a program which prints all the permutations of a string in alphabetical order. Specifications: Your program should accept a file as its first argument. The file contains input ...
Legato's user avatar
  • 9,839
4votes
4answers
9kviews

Staircase problem solved using recursion

Problem Question taken from here. I want to go up a flight of stairs that has n steps. I can either take 1 or 2 steps each time. How many different ways can I go up this flight of stairs? Write a ...
overexchange's user avatar
8votes
2answers
4kviews

Consecutive Primes challenge at CodeEval.com and memory allocation issue

I finally solved this challenge with using recursion and figured out why the automatic scorer wasn't passing my previous solutions. I was using NSMutableArray to ...
Yan's user avatar
  • 683

close